<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>


<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<meta name="theme-color" content="#f8f5ec" />
<meta name="msapplication-navbutton-color" content="#f8f5ec">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="#f8f5ec">



  <meta name="description" content="看着狗书重构吐槽"/>




  <meta name="keywords" content="开发, flask, python, 八一" />



  <meta name="baidu-site-verification" content="HhUstaSjr0" />



  <meta name="google-site-verification" content="UA-102975942-1" />






  <link rel="alternate" href="/atom.xml" title="八一">




  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=2.6.0" />



<link rel="canonical" href="https://bay1.top/2017/08/24/看着狗书重构吐槽/"/>


<link rel="stylesheet" type="text/css" href="/css/style.css?v=2.6.0" />
<link rel="stylesheet" type="text/css" href="/css/prettify.css" media="screen" />
<link rel="stylesheet" type="text/css" href="/css/sons-of-obsidian.css" media="screen" />



  <link rel="stylesheet" type="text/css" href="/lib/fancybox/jquery.fancybox.css" />




  
  <script id="baidu_analytics">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?9a885cc9fb6cd7bcef579deb8efe8a70";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>



  <script id="google_analytics">
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
        (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
        m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
        })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

        ga('create', 'UA-102975942-1', 'auto');
        ga('send', 'pageview');
  </script>










    <title> 看着狗书重构吐槽 - 八一 </title>
  </head>

  <body><div id="mobile-navbar" class="mobile-navbar">
  <div class="mobile-header-logo">
    <a href="/." class="logo">八一</a>
  </div>
  <div class="mobile-navbar-icon">
    <span></span>
    <span></span>
    <span></span>
  </div>
</div>

<nav id="mobile-menu" class="mobile-menu slideout-menu">
  <ul class="mobile-menu-list">
    
      <a href="/archives">
        <li class="mobile-menu-item">
          
          
            文章
          
        </li>
      </a>
    
      <a href="/tags">
        <li class="mobile-menu-item">
          
          
            标签
          
        </li>
      </a>
    
      <a href="/about">
        <li class="mobile-menu-item">
          
          
            关于/友链
          
        </li>
      </a>
    
      <a href="/search">
        <li class="mobile-menu-item">
          
          
            站内搜索
          
        </li>
      </a>
    
  </ul>
</nav>

    <div class="container" id="mobile-panel">
      <header id="header" class="header"><div class="logo-wrapper">
  <a href="/." class="logo">八一</a>
</div>

<nav class="site-navbar">
  
    <ul id="menu" class="menu">
      
        <li class="menu-item">
          <a class="menu-item-link" href="/archives">
            
            
              文章
            
          </a>
        </li>
      
        <li class="menu-item">
          <a class="menu-item-link" href="/tags">
            
            
              标签
            
          </a>
        </li>
      
        <li class="menu-item">
          <a class="menu-item-link" href="/about">
            
            
              关于/友链
            
          </a>
        </li>
      
        <li class="menu-item">
          <a class="menu-item-link" href="/search">
            
            
              站内搜索
            
          </a>
        </li>
      
    </ul>
  
</nav>

      </header>

      <main id="main" class="main">
        <div class="content-wrapper">
          <div id="content" class="content">
            
  
  <article class="post">
    <header class="post-header">
      <h1 class="post-title">
        
          看着狗书重构吐槽
        
      </h1>

      <div class="post-meta">
        <span class="post-time">
          2017-08-24
        </span>
        
        
        
      </div>
    </header>

    
    
  <div class="post-toc" id="post-toc">
    <h2 class="post-toc-title">文章目录</h2>
    <div class="post-toc-content">
      <ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#上传头像404"><span class="toc-text">上传头像404</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#头像更换删除原来的图片"><span class="toc-text">头像更换删除原来的图片</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#使用forgery-py生成测试数据"><span class="toc-text">使用forgery_py生成测试数据</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#用profile协助程序性能优化"><span class="toc-text">用profile协助程序性能优化</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#定义匿名用户"><span class="toc-text">定义匿名用户</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#AttributeError-‘User’-object-has-no-attribute-‘is-active’"><span class="toc-text">AttributeError: ‘User’ object has no attribute ‘is_active’</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#使用markdown同步实现markdown"><span class="toc-text">使用markdown同步实现markdown</span></a></li></ol>
    </div>
  </div>


    <div class="post-content">
      
        <p>混杂着工作室图片网任务,截至今天终于完成了暑假另一个任务 <a id="more"></a><br>把考核任务按照狗书再写一遍<br>受益匪浅，路途荆棘丛生。。。。<br><a href="https://github.com/bayi27/MessageBoard" target="_blank" rel="noopener">代码</a><br><a href="http://liuyan.flywinky.top/" target="_blank" rel="noopener">吐点槽</a></p>
<h2 id="上传头像404"><a href="#上传头像404" class="headerlink" title="上传头像404"></a>上传头像404</h2><blockquote>
<p><a href="http://docs.jinkan.org/docs/flask/patterns/fileuploads.html" target="_blank" rel="noopener">Flask上传文件</a><br>我实现的主要思路就是,上传文件到服务器,然后读取文件<br>当然你可以用二进制存进数据库,或者用比较成熟的拓展<a href="https://pythonhosted.org/Flask-Uploads/" target="_blank" rel="noopener">Flask-Uploads</a><br>主要的步骤以前一篇文章写了 <a href="https://bayi87.github.io/2017/08/19/%E5%A6%82%E4%BD%95%E5%AE%9E%E7%8E%B0%E5%9B%BE%E7%89%87%E4%B8%8A%E4%BC%A0API/" target="_blank" rel="noopener">如何实现图片上传API</a></p>
</blockquote>
<p>然后你需要定义访问路由</p>
<figure class="highlight ruby"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">@main.route(<span class="string">'/avatar/&lt;filename&gt;'</span>)</span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">get_file</span><span class="params">(filename)</span></span><span class="symbol">:</span></span><br><span class="line">    <span class="keyword">return</span> send_from_directory(current_app.config[<span class="string">'UPLOAD_FOLDER'</span>],filename)</span><br></pre></td></tr></table></figure>
<p>一开始的UPLOAD_FOLDER没有定义清楚,加上os.getcwd()获取当前目录</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">UPLOAD_FOLDER</span>= os.getcwd()+<span class="string">'/app/upload/avatar'</span></span><br></pre></td></tr></table></figure>
<p>如果用的Jinja2模板,在头像引用处这样写就可以了<br>我这里把头像地址存到了user数据模型中</p>
<figure class="highlight routeros"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">&lt;img <span class="attribute">class</span>=<span class="string">"img-rounded profile-thumbnail"</span> <span class="attribute">width</span>=<span class="string">"180"</span> <span class="attribute">height</span>=<span class="string">"180"</span> <span class="attribute">src</span>=<span class="string">"&#123;&#123; url_for('main.get_file',filename=user.avatar) &#125;&#125;"</span>&gt;</span><br></pre></td></tr></table></figure>
<h2 id="头像更换删除原来的图片"><a href="#头像更换删除原来的图片" class="headerlink" title="头像更换删除原来的图片"></a>头像更换删除原来的图片</h2><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">if</span> current_user.avatar:</span><br><span class="line">	<span class="keyword">try</span>:</span><br><span class="line">        os.remove(os.path.join(current_app.config[<span class="string">'UPLOAD_FOLDER'</span>],current_user.avatar))</span><br><span class="line">    <span class="keyword">except</span> OSError:</span><br><span class="line">        <span class="keyword">return</span> &#123;<span class="string">"error"</span>: <span class="string">u'文件不存在'</span>&#125;</span><br></pre></td></tr></table></figure>
<h2 id="使用forgery-py生成测试数据"><a href="#使用forgery-py生成测试数据" class="headerlink" title="使用forgery_py生成测试数据"></a>使用forgery_py生成测试数据</h2><blockquote>
<p>开发测试的时候经常需要大量的数据,比如下面的用户模型<br>shell运行,输入下面的代码即可</p>
</blockquote>
<figure class="highlight vim"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">python</span> manage.<span class="keyword">py</span> <span class="keyword">shell</span></span><br><span class="line">&gt;&gt;&gt;User.generate_fake()</span><br></pre></td></tr></table></figure>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">@staticmethod</span></span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">generate_fake</span><span class="params">(count=<span class="number">100</span>)</span>:</span> <span class="comment">#数量100</span></span><br><span class="line">        <span class="keyword">from</span> sqlalchemy.exc <span class="keyword">import</span> IntegrityError</span><br><span class="line">        <span class="keyword">from</span> random <span class="keyword">import</span> seed</span><br><span class="line">        <span class="keyword">import</span> forgery_py  <span class="comment">#生成虚拟数据所需要的库</span></span><br><span class="line"></span><br><span class="line">        seed()</span><br><span class="line">        <span class="keyword">for</span> i <span class="keyword">in</span> range(count):</span><br><span class="line">            u = User(username=forgery_py.internet.user_name(<span class="keyword">True</span>),</span><br><span class="line">                    location=forgery_py.address.city(),</span><br><span class="line">                    about_me=forgery_py.lorem_ipsum.sentence(),</span><br><span class="line">                    password=forgery_py.lorem_ipsum.word())</span><br><span class="line">            db.session.add(u)</span><br><span class="line">            <span class="keyword">try</span>:</span><br><span class="line">                db.session.commit()</span><br><span class="line">            <span class="keyword">except</span> IntegrityError:</span><br><span class="line">                db.session.rollback()</span><br></pre></td></tr></table></figure>
<h2 id="用profile协助程序性能优化"><a href="#用profile协助程序性能优化" class="headerlink" title="用profile协助程序性能优化"></a>用profile协助程序性能优化</h2><p><a href="http://blog.csdn.net/zhengpeitao/article/details/46714213" target="_blank" rel="noopener">前辈博客</a><br>启动方式<strong>python manage.py profile</strong></p>
<figure class="highlight nix"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">@manager.command</span><br><span class="line">def profile(<span class="attr">length=25,</span> <span class="attr">profile_dir=None):</span></span><br><span class="line">    from werkzeug.contrib.profiler <span class="built_in">import</span> ProfilerMiddleware</span><br><span class="line">    app.<span class="attr">wsgi_app</span> = ProfilerMiddleware(app.wsgi_app, <span class="attr">restrictions=[length],</span></span><br><span class="line">                                      <span class="attr">profile_dir=profile_dir)</span></span><br><span class="line">    app.run()</span><br></pre></td></tr></table></figure>
<h2 id="定义匿名用户"><a href="#定义匿名用户" class="headerlink" title="定义匿名用户"></a>定义匿名用户</h2><p>定义<br><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">from</span> flask_login <span class="keyword">import</span> AnonymousUserMixin</span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">AnonymousUser</span><span class="params">(AnonymousUserMixin)</span>:</span></span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">__init__</span><span class="params">(self)</span>:</span></span><br><span class="line">        self.username = <span class="string">'游客'</span></span><br><span class="line"></span><br><span class="line">login_manager.anonymous_user = AnonymousUser</span><br></pre></td></tr></table></figure></p>
<p>判断当前用户是否是匿名用户<br><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">current_user.is_anonymous() <span class="comment">#bool型</span></span><br><span class="line"><span class="keyword">if</span>的时候用current_user.is_anonymous</span><br></pre></td></tr></table></figure></p>
<p>Jinja模板中</p>
<figure class="highlight django"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="xml"></span><span class="template-tag">&#123;% <span class="name"><span class="name">if</span></span> current_user.is_authenticated() %&#125;</span><span class="xml"></span></span><br><span class="line"><span class="xml">  Hi </span><span class="template-variable">&#123;&#123; current_user.name &#125;&#125;</span><span class="xml">!</span></span><br><span class="line"><span class="xml"></span><span class="template-tag">&#123;% <span class="name"><span class="name">endif</span></span> %&#125;</span><span class="xml"></span></span><br></pre></td></tr></table></figure>
<h2 id="AttributeError-‘User’-object-has-no-attribute-‘is-active’"><a href="#AttributeError-‘User’-object-has-no-attribute-‘is-active’" class="headerlink" title="AttributeError: ‘User’ object has no attribute ‘is_active’"></a>AttributeError: ‘User’ object has no attribute ‘is_active’</h2><blockquote>
<p>User需要继承UserMixin,并添加一个user_loader</p>
</blockquote>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">from</span> flask_login <span class="keyword">import</span> UserMixin</span><br><span class="line"></span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">User</span><span class="params">(db.Model, UserMixin)</span>:</span></span><br><span class="line">	<span class="keyword">pass</span></span><br><span class="line"></span><br><span class="line"><span class="meta">@login_manager.user_loader</span></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">load_user</span><span class="params">(userid)</span>:</span></span><br><span class="line">    <span class="keyword">return</span> User.query.get(int(userid))</span><br></pre></td></tr></table></figure>
<h2 id="使用markdown同步实现markdown"><a href="#使用markdown同步实现markdown" class="headerlink" title="使用markdown同步实现markdown"></a>使用markdown同步实现markdown</h2><p><img src="https://s1.ax1x.com/2018/01/01/pSRbv9.png" alt="效果"></p>
<blockquote>
<p>首先在create_app中初始化PageDown<br>forms输入部分定义为PageDownField</p>
</blockquote>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">from</span> flask_pagedown <span class="keyword">import</span> PageDown</span><br><span class="line">pagedown = PageDown()</span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">create_app</span><span class="params">(config_name)</span>:</span></span><br><span class="line">    app = Flask(__name__)</span><br><span class="line">    app.config.from_object(config[config_name])</span><br><span class="line">    pagedown.init_app(app)</span><br><span class="line">    ...</span><br></pre></td></tr></table></figure>
<blockquote>
<p>Jinja2中引入</p>
</blockquote>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">&#123;% block scripts %&#125;</span><br><span class="line">&#123;&#123; super() &#125;&#125;</span><br><span class="line">&#123;&#123; pagedown.include_pagedown() &#125;&#125;</span><br><span class="line">&#123;% endblock %&#125;</span><br></pre></td></tr></table></figure>
<blockquote>
<p>模型中为了安全,防止恶意标签<br>首先，markdown() 函数初步把Markdown 文本转换成HTML<br>然后，把得到的结果和允许使用的HTML 标签列表传给clean() 函数<br>clean() 函数删除所有不在白名单中的标签<br>转换的最后一步由linkify() 函数完成，这个函数由Bleach 提供<br>把纯文本中的URL 转换成适当的链接</p>
</blockquote>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">Post</span><span class="params">(db.Modle)</span>:</span></span><br><span class="line">	....</span><br><span class="line">	<span class="comment">#处理富文本，将Markdown格式转换为Html</span></span><br><span class="line"><span class="meta">    @staticmethod</span></span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">on_changed_body</span><span class="params">(target, value, oldvalue, initiator)</span>:</span></span><br><span class="line">        allowed_tags = [<span class="string">'a'</span>, <span class="string">'abbr'</span>, <span class="string">'acronym'</span>, <span class="string">'b'</span>, <span class="string">'blockquote'</span>, <span class="string">'code'</span>,</span><br><span class="line">                        <span class="string">'em'</span>, <span class="string">'i'</span>, <span class="string">'li'</span>, <span class="string">'ol'</span>, <span class="string">'pre'</span>, <span class="string">'strong'</span>, <span class="string">'ul'</span>,</span><br><span class="line">                        <span class="string">'h1'</span>, <span class="string">'h2'</span>, <span class="string">'h3'</span>, <span class="string">'p'</span>]</span><br><span class="line">        target.body_html = bleach.linkify(bleach.clean(</span><br><span class="line">            markdown(value, output_format=<span class="string">'html'</span>),</span><br><span class="line">            tags=allowed_tags, strip=<span class="keyword">True</span>))</span><br><span class="line"></span><br><span class="line">db.event.listen(Post.body, <span class="string">'set'</span>, Post.on_changed_body)<span class="comment">#实时监听</span></span><br></pre></td></tr></table></figure>
<p><img src="https://s1.ax1x.com/2018/01/01/pSRHgJ.gif" alt="效果"></p>
<blockquote>
<p>能记住的大概就这些了,其他的都是很杂的错误,不管怎么说,也是次经历了</p>
</blockquote>
<p>参考链接：<a href="http://blog.csdn.net/bestallen/article/details/52526386" target="_blank" rel="noopener">bestallen的博客</a></p>

      
    </div>

    
      
      



      
      
    

    
      <footer class="post-footer">
        
          <div class="post-tags">
            
              <a href="/tags/开发/">开发</a>
            
              <a href="/tags/flask/">flask</a>
            
              <a href="/tags/python/">python</a>
            
          </div>
        
        
        
  <nav class="post-nav">
    
      <a class="prev" href="/2017/09/06/最近干的事/">
        <i class="iconfont icon-left"></i>
        <span class="prev-text nav-default">最近干的事</span>
        <span class="prev-text nav-mobile">上一篇</span>
      </a>
    
    
      <a class="next" href="/2017/08/19/如何实现图片上传API/">
        <span class="next-text nav-default">如何实现图片上传API</span>
        <span class="prev-text nav-mobile">下一篇</span>
        <i class="iconfont icon-right"></i>
      </a>
    
  </nav>

      </footer>
    

  </article>


          </div>
          
  <div class="comments" id="comments">
      <div id="disqus_thread">
        <noscript>
          Please enable JavaScript to view the
          <a href="//disqus.com/?ref_noscript">comments powered by Disqus.</a>
        </noscript>
      </div> 
    </div>
  </div>


        </div>
      </main>

      <footer id="footer" class="footer">

  <div class="social-links">
    
      
        
          <a href="https://github.com/bay1" class="iconfont icon-github" title="github"></a>
        
      
    
      
        
          <a href="http://weibo.com/3190704711/profile?topnav=1&wvr=6&is_all=1" class="iconfont icon-weibo" title="weibo"></a>
        
      
    
      
    
      
    
      
    
    
    
  </div>


<div class="copyright">
  <span class="copyright-year">
    
    &copy; 
     
      2016 - 
    
    2018
    <span class="author">bay1</span>
  </span>
</div>
      </footer>

      <div class="back-to-top" id="back-to-top">
        <i class="iconfont icon-up"></i>
      </div>
    </div>

    
  
  <script type="text/javascript">
    var disqus_config = function () {
        this.page.url = 'https://bay1.top/2017/08/24/看着狗书重构吐槽/';
        this.page.identifier = '2017/08/24/看着狗书重构吐槽/';
        this.page.title = '看着狗书重构吐槽';
    };
    (function() {
    var d = document, s = d.createElement('script');

    s.src = '//https-blog-flywinky-top-1.disqus.com/embed.js';

    s.setAttribute('data-timestamp', +new Date());
    (d.head || d.body).appendChild(s);
    })();  
  </script>



    
  





  
    <script type="text/javascript" src="/lib/jquery/jquery-3.1.1.min.js"></script>
  

  
    <script type="text/javascript" src="/lib/slideout/slideout.js"></script>
  

  
    <script type="text/javascript" src="/lib/fancybox/jquery.fancybox.pack.js"></script>
  


    <script type="text/javascript" src="/js/src/even.js?v=2.6.0"></script>
<script type="text/javascript" src="/js/src/bootstrap.js?v=2.6.0"></script>
<script src="/js/prettify.js"></script>
<script type="text/javascript">
$(document).ready(function(){
 $('pre').addClass('prettyprint');
   prettyPrint();
 })
</script>
  </body>
</html>
